崮生的笔记

思源安卓版 git 同步方法

约 380 字阅读约 1 分钟

拉取

第一次的准备

1.
安装 思源 apk
3.
安装 Termux
5.
在 Termux 中安装 git 相关软件
1.
执行命令 pkg install git
3.
执行命令 pkg install openssh
7.
去相关 git 服务配置好公钥
7.
执行命令termux-setup-storage让 Termux 获取访问其他目录的权限
9.
执行命令 cd ~/storage/shared/siyuan/data/ 进入思源的笔记目录
11.
执行命令 git clone (你的git库的 ssh 地址) 拉取 git 库
13.
在思源 app 中打开该笔记 ,🎉

之后的同步方法

1.
cd ~/storage/shared/siyuan/data/(你的笔记目录)
3.
执行命令 git pull

推送

1.
cd ~/storage/shared/siyuan/data/(你的笔记目录)
3.
执行命令 add .
5.
执行命令 git commit -m "更新了文档"
7.
执行命令 git push